package com.tangk.tool;

import java.util.logging.Logger;

import com.tangk.proxy.DefaultProxHandler;

public class ToolsFactory {
	static Logger logger = Logger.getLogger("Main");
	public static ITools creater(String key){
		if(key == null){
			throw new RuntimeException("工具名字为空");
		}
		try{
			Class<?> cls = Class.forName(key);
			return new DefaultProxHandler((ITools)cls.getMethod("getInstance").invoke(cls));
		}catch (Exception e) {
			e.printStackTrace();
		}
		throw new RuntimeException("工具初始化失败");
	}
}
